package com.xyy.saas.payment.common.exception;

import com.xyy.saas.payment.cores.enums.ResultCodeEnum;
import lombok.Getter;

/**
 * @author liujf
 */
@Getter
public class PayBizException extends RuntimeException {
    private static final long serialVersionUID = 661018015124123147L;

    private String code;

    private String msg;

    public PayBizException(String msg) {
        super(msg);
        this.code = "-1";
        this.msg = msg;
    }

    public PayBizException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getCode() + ":" + resultCodeEnum.getDisplayMsg());
        code = resultCodeEnum.getCode();
        msg = resultCodeEnum.getDisplayMsg();
    }

    public PayBizException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
}
